package com.chixing.day09_innerclass.innerclass;

import com.chixing.day09_innerclass.order.GoveOrder;
import com.chixing.day09_innerclass.order.Order;
import com.chixing.day09_innerclass.order.OrderApi;
import com.chixing.day09_innerclass.order.PersonOrder;

public class InnerTest {
    public static void main(String[] args) {
        Student stu = new Student();
        stu.stuAge = 20;
        stu.study();
        Student.StudentAdress studentAdress = stu.new StudentAdress();

        Student.StudentAdress ss;


        //成员内部类
        Outer outer = new Outer();
        outer.a = 10;
        outer.fun();
        Outer.Inner inner = outer.new Inner();//外部类对象.内部类对象
        inner.b = 10;
        inner.fun1();

        //静态内部类
        Outer.Inner2 inner2 =new Outer.Inner2();//new 外部类名.内部类名
        inner2.c = 10;

        //匿名内部类
        Order o1 = new PersonOrder();
        OrderApi orderApi1 = new PersonOrder();//创建接口对象：---子类对象PersonOrder{实现接口中的方法}

        OrderApi orderApi2 = new GoveOrder();//创建接口对象：---子类对象GoveOrder{实现接口中的方法}
        OrderApi orderApi3 = new OrderApi() {
            //创建接口对象：---子类对象【匿名对象】{实现接口中的方法}

            /*
                new OrderApi(){
                    public Order orderClone() {
                    return null;
                    }
                }
             */
            @Override
            public Order orderClone() {
                return null;
            }
        };

        orderProcess(orderApi1);
        orderProcess(orderApi2);
        orderProcess(new OrderApi() {
            @Override
            public Order orderClone() {
                return null;
            }
        });


    }
    public static void orderProcess(OrderApi orderApi){

    }

}
